package gse

import (
	"github.com/blevesearch/bleve/v2/analysis"
	"github.com/blevesearch/bleve/v2/registry"
)

func analyzerConstructor(config map[string]interface{}, cache *registry.Cache) (*analysis.Analyzer, error) {
	tokenizer, err := cache.TokenizerNamed(TokenName)
	if err != nil {
		return nil, err
	}

	az := &analysis.Analyzer{
		Tokenizer: tokenizer,
	}
	return az, nil
}

func init() {
	registry.RegisterAnalyzer(TokenName, analyzerConstructor)
	//registry.RegisterAnalyzer(SeparateName, analyzerConstructor)
}
